package com.taobao.api.request;

import java.util.Date;
import com.taobao.api.internal.util.RequestCheckUtils;
import java.util.Map;

import com.taobao.api.TaobaoRequest;
import com.taobao.api.internal.util.TaobaoHashMap;
import com.taobao.api.response.HanoiLabelUpdatePapResponse;
import com.taobao.api.ApiRuleException;
/**
 * TOP API: taobao.hanoi.label.update.pap request
 * 
 * @author auto create
 * @since 1.0, 2013-08-03 16:51:00
 */
public class HanoiLabelUpdatePapRequest implements TaobaoRequest<HanoiLabelUpdatePapResponse> {

	private Map<String, String> headerMap = new TaobaoHashMap();
	private TaobaoHashMap udfParams; // add user-defined text parameters
	private Long timestamp;

	/** 
	* 认证信息
	 */
	private String appName;

	/** 
	* 针对标签的一个简单描述
	 */
	private String description;

	/** 
	* 标签最近一次修改时间
	 */
	private Date gmtModified;

	/** 
	* 要修改的标签的id
	 */
	private Long id;

	/** 
	* 标签的编码，用于检索
	 */
	private String labelCode;

	/** 
	* 标签的名称
	 */
	private String name;

	/** 
	* 开放策略 true 开放
	 */
	private Boolean open;

	/** 
	* 针对模板表达式中需要设置的参数的一个实例化，List<ParameterVO>对象的json格式
	 */
	private String paras;

	/** 
	* 场景字段
	 */
	private Long scene;

	/** 
	* 标签对应的模板id。修改了模板，必须同时修改标签的参数paras
	 */
	private Long templateId;

	public void setAppName(String appName) {
		this.appName = appName;
	}
	public String getAppName() {
		return this.appName;
	}

	public void setDescription(String description) {
		this.description = description;
	}
	public String getDescription() {
		return this.description;
	}

	public void setGmtModified(Date gmtModified) {
		this.gmtModified = gmtModified;
	}
	public Date getGmtModified() {
		return this.gmtModified;
	}

	public void setId(Long id) {
		this.id = id;
	}
	public Long getId() {
		return this.id;
	}

	public void setLabelCode(String labelCode) {
		this.labelCode = labelCode;
	}
	public String getLabelCode() {
		return this.labelCode;
	}

	public void setName(String name) {
		this.name = name;
	}
	public String getName() {
		return this.name;
	}

	public void setOpen(Boolean open) {
		this.open = open;
	}
	public Boolean getOpen() {
		return this.open;
	}

	public void setParas(String paras) {
		this.paras = paras;
	}
	public String getParas() {
		return this.paras;
	}

	public void setScene(Long scene) {
		this.scene = scene;
	}
	public Long getScene() {
		return this.scene;
	}

	public void setTemplateId(Long templateId) {
		this.templateId = templateId;
	}
	public Long getTemplateId() {
		return this.templateId;
	}

	public Long getTimestamp() {
		return this.timestamp;
	}

	public void setTimestamp(Long timestamp) {
		this.timestamp = timestamp;
	}

	public String getApiMethodName() {
		return "taobao.hanoi.label.update.pap";
	}

	public Map<String, String> getTextParams() {		
		TaobaoHashMap txtParams = new TaobaoHashMap();
		txtParams.put("app_name", this.appName);
		txtParams.put("description", this.description);
		txtParams.put("gmt_modified", this.gmtModified);
		txtParams.put("id", this.id);
		txtParams.put("label_code", this.labelCode);
		txtParams.put("name", this.name);
		txtParams.put("open", this.open);
		txtParams.put("paras", this.paras);
		txtParams.put("scene", this.scene);
		txtParams.put("template_id", this.templateId);
		if(this.udfParams != null) {
			txtParams.putAll(this.udfParams);
		}
		return txtParams;
	}

	public void putOtherTextParam(String key, String value) {
		if(this.udfParams == null) {
			this.udfParams = new TaobaoHashMap();
		}
		this.udfParams.put(key, value);
	}

	public Class<HanoiLabelUpdatePapResponse> getResponseClass() {
		return HanoiLabelUpdatePapResponse.class;
	}

	public void check() throws ApiRuleException {
		RequestCheckUtils.checkNotEmpty(appName,"appName");
		RequestCheckUtils.checkNotEmpty(gmtModified,"gmtModified");
		RequestCheckUtils.checkNotEmpty(id,"id");
	}

	public Map<String, String> getHeaderMap() {
		return headerMap;
	}
}
